import { createApp } from 'vue'
import { createPinia } from 'pinia'
import { createRouter, createWebHistory } from 'vue-router'
import App from './App.vue'
import HomePage from './HomePage'
import CompositionApiDemo from './CompositionApiDemo'
import Vue3FeaturesDemo from './Vue3FeaturesDemo' // 添加这一行

// 导入 TDesign 组件库和样式
import TDesign from 'tdesign-vue-next'
import 'tdesign-vue-next/es/style/index.css'

// 创建路由
const routes = [
  { path: '/', component: HomePage },
  { path: '/composition-api', component: CompositionApiDemo },
  { path: '/vue3-features', component: Vue3FeaturesDemo } // 添加这一行
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

// 创建应用
const app = createApp(App)

// 使用插件
app.use(createPinia())
app.use(router)
app.use(TDesign)

app.mount('#app')